package com.yang.service;

import com.yang.dao.ProductMapper;
import com.yang.pojo.Product;

import java.util.List;


public class ProductServiceImpl implements ProductService {
    //调用dao层的操作，设置一个set接口，方便Spring管理
    private ProductMapper productMapper;

    @Override
    public List<Product> queryProductByKind(String kind) {
        List<Product> list=productMapper.queryProductByKind(kind);
        return list;
    }

    public ProductServiceImpl(ProductMapper productMapper) {
        this.productMapper = productMapper;
    }

    @Override
    public Product queryProductByName(String productName ) {
        return productMapper.queryBookByName(productName);
    }

    @Override
    public List<Product> allProduct() {
        return productMapper.allProduct();
    }

    @Override
    public int addProduct(Product product) {
        return productMapper.addProduct(product);
    }

    public void setProductMapper(ProductMapper productMapper) {
    }
}
